package tests.pl.shenlon.poker.cards;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;

import pl.shenlon.poker.cards.Card;
import pl.shenlon.poker.cards.CardRank;
import pl.shenlon.poker.cards.CardSuit;
import pl.shenlon.poker.cards.Hand;

public class HandTest {

	private Hand hand;

	@Before
	public void setUp() {
		Card[] cards = {
				new Card(CardSuit.CLUBS, CardRank.TEN),
				new Card(CardSuit.SPADES, CardRank.TWO), 
		};
		hand = new Hand(cards);
	}

	@Test
	public void testContainsCard() {
		Card card = new Card(CardSuit.CLUBS, CardRank.TEN);
		Assert.assertFalse(hand.containsCard(card));
		hand.getCard(0).setFaceUp(true);
		Assert.assertTrue(hand.containsCard(card));
	}

	@Test
	public void testStringConstructor() {
		Hand hand = new Hand("A♣-A♣-A♣-A♣");
		Assert.assertEquals("A♣-A♣-A♣-A♣", hand.toString());
		hand = new Hand("A♣-10♣-A♣-A♣");
		Assert.assertEquals("A♣-10♣-A♣-A♣", hand.toString());
	}

}